Influence of Photoplethysmogram Signal Quality on Pulse Arrival Time during Polysomnography

Intervals of low-quality photoplethysmogram (PPG) signals might lead to significant inaccuracies in estimation of pulse arrival time (PAT) during polysomnography (PSG) studies. While PSG is considered to be a “gold standard” test for diagnosing obstructive sleep apnea (OSA), it also enables tracking apnea-related nocturnal blood pressure fluctuations correlated with PAT. Since the electrocardiogram (ECG) is recorded synchronously with the PPG during PSG, it makes sense to use the ECG signal for PPG signal-quality assessment. (1) Objective: to develop a PPG signal-quality assessment algorithm for robust PAT estimation, and investigate the influence of signal quality on PAT during various sleep stages and events such as OSA. (2) Approach: the proposed algorithm uses R and T waves from the ECG to determine approximate locations of PPG pulse onsets. The MESA database of 2055 PSG recordings was used for this study. (3) Results: the proportions of high-quality PPG were significantly lower in apnea-related oxygen desaturation (matched-pairs rc = 0.88 and rc = 0.97, compared to OSA and hypopnea, respectively, when p < 0.001) and arousal (rc = 0.93 and rc = 0.98, when p < 0.001) than in apnea events. The significantly large effect size of interquartile ranges of PAT distributions was between low- and high-quality PPG (p < 0.001, rc = 0.98), and regular and irregular pulse waves (p < 0.001, rc = 0.74), whereas a lower quality of the PPG signal was found to be associated with a higher interquartile range of PAT across all subjects. Suggested PPG signal quality-based PAT evaluation reduced deviations (e.g., rc = 0.97, rc = 0.97, rc = 0.99 in hypopnea, oxygen desaturation, and arousal stages, respectively, when p < 0.001) and allowed obtaining statistically larger differences between different sleep stages and events. (4) Significance: the implemented algorithm has the potential to increase the robustness of PAT estimation in PSG studies related to nocturnal blood pressure monitoring.


Introduction
Photoplethysmography (PPG) is a non-invasive technology that enables tracking changes of human blood volume in peripheral blood vessels in order to assess hemodynamic activity. In clinical practice, PPG is commonly used in pulse oximeters to estimate arterial blood oxygen saturation (SpO2) [1][2][3][4]. Variations in SpO2 are often observed during full night polysomnography (PSG) studies [5][6][7][8]. The PSG test is considered the "gold standard" for diagnosing obstructive sleep apnea (OSA) and other sleep-related breathing disorders [9]. During PSG, many different biosignals are recorded to extract clinically

Data
In this study, the Multi-Ethnic Study of Atherosclerosis (MESA) dataset [40,41] was used to implement and investigate the PPG signal-quality assessment algorithm. The MESA dataset contains data from 2055 patients aged 54-95 years old, totaling 16,300 h full overnight annotated PSG signals. Recordings were performed at home using the Compumedics Somte system. ECG and PPG signals with a sampling rate of 256 Hz were analyzed. PPG signals were recorded from the finger using the Nonin 8000 sensor. Figure 1 shows examples of MESA multichannel physiological signals recorded during OSA and hypopnea episodes. The quality of PPG signals was analyzed in following annotated categories of the MESA dataset: (1) sleep stages-NREM1, NREM2, NREM3, REM, and the wake stage; (2) sleep-disordered breathing related events-OSA, hypopnea, SpO2 desaturations, and arousal episodes.

ECG & PPG Pre-Processing
The ECG signal was filtered by a zero-phase forth-order Butterworth low-pass filter with a cut-off frequency of 25 Hz to remove high-frequency interference. The baseline was removed to facilitate detection of ECG waves as follows [42]. The baseline was calculated by using a median filter with overlapping windows of 1 s duration and 0.5 s overlap. This was interpolated and subtracted from the ECG signal.
The PPG signal was filtered by a zero-phase forth-order Butterworth band-pass filter with a pass-band of 0.4-6 Hz.

. Identifying R and T Waves in ECG Signals
The R-DECO algorithm [43][44][45] was used to detect R waves in ECG signals. Due to its small number of operations and simplicity, the algorithm is particularly suitable for processing long-term recordings, such as ECG signals registered during PSG. The R-DECO algorithm has been found to perform well, with sensitivity of 99.6% and positive predictive value of 99.7% [43] in the MIT/BIH arrhythmia database [46].
After detection of R waves, a low-complexity detection of T waves was performed (see Figure 3). It was observed that this implemented approach works more accurately and efficiently on MESA ECG signals than other open-access algorithms to detect T waves [47,48]. To facilitate detection of the T wave, the smoothed ECG signal was obtained by additionally filtering the prepossessed ECG. This was performed using a zero-phase 4th order Butterworth band-pass filter with a pass-band of 1-6 Hz. In the next step, the position of the T peak was located in a search region of the smoothed ECG signal. It was assumed that the approximate duration of the RS interval is equal to half of the maximum duration of the QRS complex in the normal range, i.e., 0.12 s [49]. Therefore, to detect T waves as accurately as possible, a search region was limited from the approximate position of the S peak till the following R wave and defined as [R i + 0.06 (s) : R i+1 ]. This limitation in the smoothed ECG helped us to avoid misattributions of T waves. Then the position of the first peak in a search region was identified as the position of the T wave.  Figure 3. A low-complexity detection of T waves from the ECG signal by using additional filtering.

Determining the Locations of PPG Pulse Onsets
The locations of PPG pulse onsets were determined as PPG minimum points between ECG R and T waves. The pulse onset is caused by the heart starting to pump blood into the vessels, whereas the ECG T wave reflects ventricular repolarization, and its location is nearby with that of the PPG pulse onset [50,51].

Assessing the Variability in PPG Pulse Amplitudes
It might be complicated to exploit pulse intervals for assessing the quality of the PPG signal characterized by an irregular pattern of cardiac activity. For instance, pulse intervals vary greatly during arrhythmia, thus their use could result in PPG signals collected during arrhythmia being falsely classified as low quality. The alternative proposed approach is to use the finite differences of the PPG signal envelope.
First, the absolute second derivative of the PPG signal envelope, |e" PPG |, was calculated as follows. The PPG signal envelope, e PPG , was defined as the maximum value of the PPG signal in the delineated interval between each pair of adjacent pulse onsets (see Algorithm 1 description for further details). Then, e PPG was absolutely differentiated twice (i.e., the absolute second derivative |e" PPG | of the PPG signal envelope, e PPG ) as described below: where e PPG is the PPG signal envelope, |e" PPG | is the absolute second derivative of the e PPG , and i is a beat index. Second, |e" PPG | was processed for analysis. To do so, |e" PPG | was smoothed by using a fifth-order median filter, and then |e" PPG | s was obtained. In addition, |e" PPG | s was offset as follows. In most cases, the initial and final segments of PSG signals, especially signals sensitive to motion artifacts such as PPG, were corrupted as subjects were often awake at these times. Since the analysis of the PPG signal was off-line, in order to separate the DC component of |e" PPG | s , the DC component was calculated as the mean value of a central 50% of the signal. Only a central part of the signal was selected due to observed PPG quality issues in the initial and final segments of PSG signals, thus allowing a more robust assessment of the mean value of |e" PPG | s . |e" PPG | s was then offset by subtracting the estimated DC component from it k times, and then |e" PPG | o was calculated. The procedure is described as follows: where k is the subtraction constant for offsetting, N is the length of the |e" PPG | s , and i is a beat index.

Identifying Low-Quality PPG Pulse Waves
Two thresholds, θ 1 and θ 2 , were used to identify low-quality pulses in PPG. The first threshold θ 1 was defined as the limit value of the |e" PPG | o . The second threshold θ 2 was defined as the limit value of the PPG signal envelope, e PPG . The segmentation of low-quality pulse waves is described as follows: where signal quality index SQI = 1 indicates that a PPG pulse wave was of high quality, and SQI = 0 indicates low quality. Figure 4 shows an example of the segmentation of low-quality PPG pulse waves.

PAT Estimation
PAT was estimated as the time interval between the ECG R peak and the PPG systolic peak. It was decided to use the PPG systolic peak for PAT estimation, rather than the PPG pulse onset because it allowed us to obtain more noticeable dipping pattern of PAT during apnea events. The PPG systolic peak was defined as the maximum value of the PPG signal in the delineated interval between each pair of adjacent pulse onsets, which were determined as described in Section 2.3.2. Figure 5 shows an example of PAT variations and its relations with estimated PPG signal quality.

PAT Post-Processing
PAT post-processing consisted of correcting low-quality intervals and interpolation of PAT sequences (see Figure 2). PAT values corresponding to low-quality PPG pulse waves were obtained as the mean of the M following PAT values as described below: where i is a beat index, and M is the order of averaging. Additionally, obtained PAT sequences were processed by using a n-order median filter. As PAT was estimated for each pulse-to-pulse interval and indexed by i, where i is the order of the beat occurring at time t(i), modified Akima cubic Hermite interpolation method [52] was used to obtain a PAT signal uniformly sampled in time with a sampling rate of 5 Hz. Figure 5c shows PAT before post-processing, PAT b , and after post-processing, PAT a , respectively.

PAT Changes during Sleep-Disordered Breathing
PAT changes during OSA episodes are illustrated in Figure 6. Additionally, variations in SpO2 are provided for comparison. Based on SpO2 variability, we can see that after PPG quality-based post-processing the dipping pattern of PAT is distinguished more obviously.
More precisely estimated dipping pattern shows that PAT tended to decrease significantly more after the OSA episode or at the end of the event than during it. After post-processing obtained PAT estimates were compared with SpO2. The percentage change was calculated as the range of values, divided by the maximum value. The changes during and 30 s after OSA and hypopnea episodes were assessed for PAT and SpO2.

Irregular Rhythm Detection
Intervals of irregular rhythm were identified in order to investigate the signal quality and PAT distributions during regular and irregular beat-to-beat intervals. To do so, a fast and simple low-complexity algorithm for continuous long-term monitoring [53] was used to detect irregular rhythms, based on sequences of RR intervals from ECG signals. This detector has been found to perform well on the MIT-BIH database (sensitivity of 97.1%, specificity of 98.3%) [53]. The detector consists of ectopic beat filtering, bigeminal suppression, characterization of RR interval irregularity, and signal fusion [53]. Thus, it is based on the observation that atrial fibrillation episodes have increased RR irregularity and usually are associated with increased heart rate. The algorithm was implemented with just a few arithmetic operations per beat, using an 8-beat sliding window [53].
The last annotated segment of the wake stage at the end of PSG tests, during which a subject was already fully awake, was not analyzed for irregular rhythm detection.

Comparison of PPG Signal-Quality Assessment Algorithms
Our ECG-guided PPG signal-quality assessment algorithm was compared with the template matching (TM) approach proposed by Orphanidou et al. [28]. The TM-based approach searches for regularity in a segment which is an indicator of reliability, since a segment contaminated by artefact would be irregular in morphology [28]. This algorithm consists of [28]: (i) estimation of median beat-to-beat interval by using all the detected PPG pulse peaks of each sample; (ii) extraction of individual PPG pulse waves by using a window, the width of which is the median beat-to-beat interval, centered on each detected PPG pulse peak; (iii) generation of the mean PPG pulse wave template by taking the mean of all PPG pulse waves in the sample; (iv) estimation of the correlation coefficient of each individual PPG pulse wave with the obtained average template; and (v) estimation of the average correlation coefficient obtained by averaging all correlation coefficients over the whole PPG sample. In this work, the TM-based algorithm uses a 10 s window in order to assess the quality of the PPG.

Statistical Analysis
The quality of PPG signals was assessed by using two algorithms on the nine categories of MESA data mentioned in Section 2.1: NREM1, NREM2, NREM3, REM, and wake stages; OSA, hypopnea, SpO2 desaturation, and arousal episodes.
Additionally, the computational efficiency of both algorithms was assessed by measuring the time taken to analyze the PPG signals (with approximate duration of 12 h). The main parameters of the computer used for this purpose are provided as follows: processor-AMD Ryzen Threadripper PRO 5995WX 64-Cores, 2.70 GHz, 64-bit operating system, RAM-128 GB.
The Anderson-Darling test found no Gaussian distribution in the analyzed data. The non-parametric paired Wilcoxon signed rank test was used to test for statistical differences between: (i) proportions of high-quality PPG in different sleep stages and events related to sleep-disordered breathing; (ii) interquartile ranges of PAT distributions in highand low-quality PPG segments/regular and irregular rhythms, and proportions of highquality PPG in them; (iii) interquartile ranges of PAT distributions in different sleep stages and events related to sleep-disordered breathing; (iv) percentage changes of PAT and SpO2 during and after apnea event. Additionally, the effect size was estimated by using matched-pairs rank biserial correlation coefficient r c values [54]. For this purpose, median values for each subject were obtained and compared. The effect size is considered small when matched-pairs r c < 0.30, medium-r c ≥ 0.30, and large-r c ≥ 0.50 [55].

Parameter Settings
In order to detect low-quality pulses in PPG, after |e" PPG | s offsetting, the first threshold was defined as θ 1 = 0, assuming that no amplitude disturbances in high-quality PPG exists. The second threshold was defined with assumption as θ 2 = 0.0005, the limit value of the PPG signal envelope, e PPG , with which it is still possible to reliably investigate the morphology of the PPG pulse waveform. The subtraction constant for |e" PPG | s offsetting (see Equation (2)) was selected k = 3, allowing θ 1 = 0 to be meaningful for distinguishing low-quality PPG segments correctly in most cases.
The definition of the subtraction constant, k, is related to the threshold, θ 1 . The aim was to subtract the mean value of the |e" PPG | s so many times that after this kind of offsetting the values of the obtained |e" PPG | o in high-quality PPG intervals would be less than the first threshold, θ 1 . By using grid search within the range k = 0.5 ÷ 5, the first such determined value satisfying these conditions was k = 3.
The second threshold, θ 2 , was used to exclude low-quality PPG segments with distorted morphology due to possible poor contact of the sensor with the skin. By investigating four cases-θ 2 = 0.05, 0.005, 0.0005, 0.00005, we found that θ 2 = 0.0005 allows us to distinguish these distorted PPG segments from high-quality PPG intervals correctly.
The orders of averaging and median filtering for PAT sequences were selected M = 5 and n = 15, respectively, which allowed us to significantly reduce deviations in PAT beat-tobeat intervals of long-term signals.
The linear and non-linear averaging in PAT post-processing reduces outliers occurring due to low PPG signal-quality pulses. The order of linear averaging, M, was selected with the assumption that the PAT value corresponding to a low-quality PPG pulse should be approximately similar to the PAT values of the adjacent five pulses with a high quality. The order of non-linear filter was also selected empirically to n = 15 as it is a maximum value still preserving the PAT dipping pattern correlated with desaturations during apnea events without losing specific characteristics. We opted to use both linear and non-linear filters for post-processing of PAT time series. Since the linear averager is suitable for removing high frequency variations, while the median averager is suitable for removing outliers with the preservation of steep slopes of PAT signals.

Signal Quality of PPG in Different Sleep Stages and Sleep-Disordered Breathing Events
The proportion of sleep time in the MESA data was 42.6 ± 13.5% awake and 57.3 ± 13.5% asleep. The average number of events related to sleep-disordered breathing across all subjects was: 22.7 ± 45.8 OSA, 192.4 ± 118.9 hypopnea, 331.3 ± 171.6 oxygen desaturation, and 125.3 ± 96.3 arousal.
The proportions of high-quality PPG pulse waves across all subjects in each category were obtained by using the ECG-guided algorithm: 80.9% whilst awake, 98.8% whilst asleep (NREM1, NREM2, NREM3, and REM), 99.4% during apnea (OSA and hypopnea), 93.3% during oxygen desaturation, and 88.9% during arousal. This indicates that PPG signals were mostly of higher quality during sleep and apnea episodes, but of lower quality whilst awake and during oxygen desaturation and arousal events associated with sleep-disordered breathing. Figure 7 shows examples of PPG signals in wake, oxygen desaturation, and arousal segments, in which the proportions of high-quality PPG were the lowest. Additionally, low-quality segments of PPG signals classified by ECG-guided and TM-based algorithms were compared with each other. It might be observed that the ECGguided algorithm tends to detect large amplitude variations quite well and classify them as poor quality, but in some cases it classifies segments with low amplitude disturbances as high quality. Meanwhile, the TM-based algorithm often classifies PPG pulse waves of high-quality as poor-quality intervals. The proportions of PPG pulse waves classified as high quality by the ECG-guided and the reference TM-based algorithms are shown for different sleep stages in Figure 8a, and for different events in Figure 8b. For six out of the nine categories a large effect size was obtained (p < 0.001). This means that the proportion of high-quality PPG in these segments obtained by using the TM-based approach is much lower comparing it with the ECG-guided algorithm. The matched-pairs r c values of proportions of high-quality PPG between different sleep stages and events related to sleep-disordered breathing are provided in Table 1 and Table 2, respectively (p < 0.001 and r c < 0.30 is marked * , p < 0.001 and r c ≥ 0.30- * * , p < 0.001 and r c ≥ 0.50- * * * ). Table 1 and Figure 8a show that the proportion of high-quality PPG was significantly lower in the wake stage than in different sleep stages (p < 0.001, r c > 0.90). According to Table 2 and Figure 8b, it can be seen that the proportions of high-quality PPG were significantly lower in apnea-related oxygen desaturation (e.g, with the ECG-guided algorithm obtained r c = 0.88 and r c = 0.97, compared to OSA and hypopnea, respectively, when p < 0.001) and arousal (r c = 0.93 and r c = 0.98, when p < 0.001) than in apnea events. As well as, the effect sizes were larger in most cases when the quality of PPG signals was assessed by using the TM-based approach than the ECG-guided algorithm. Table 1. The matched-pairs r c values of proportions of high-quality PPG between different sleep stages obtained by using ECG-guided (orange background) and TM-based algorithms (green background). p < 0.001 and r c < 0.30 is marked * , p < 0.001 and r c ≥ 0.30- * * , p < 0.001 and r c ≥ 0.50- * * * .  Table 2. The matched-pairs r c values of proportions of high-quality PPG between sleep-disordered breathing events obtained by using ECG-guided (orange background) and TM-based algorithms (green background), where OSA-obstructive sleep apnea, HA-hypopnea, OxyDes -oxygen desaturation, Ar-arousal events. p < 0.001 and r c < 0.30 is marked * , p < 0.001 and r c ≥ 0.30- * * , p < 0.001 and r c ≥ 0.50- * * * . In terms of computational efficiency, the ECG-guided algorithm took an average of 11.6 s, whereas the TM-based algorithm result was 90.1 s for quality assessment through one signal. Therefore, the ECG-guided algorithm took approximately one eighth of the time of the TM-based approach.

PAT in High & Low-Quality PPG and Regular & Irregular Rhythms
An example of PAT variations during regular and irregular rhythms is provided in Figure 9. In addition, the PPG signal recorded during throughout PSG and signal quality estimated by the ECG-guided algorithm are shown. Since we did not have reference PAT, the way to test the effect of the signal-quality assessment is to study the variations in PAT estimates, assuming that low-quality PPG pulse waveforms lead to outlier PAT values. Therefore, interquartile ranges of PAT were analyzed in order to investigate the relationship between PPG signal quality and deviations in PAT.
Interquartile ranges of PAT distributions across all 2055 MESA subjects in high-(SQI = 1) and low-quality (SQI = 0) PPG segments are provided in Figure 10a, in which it can be seen that PPG signal quality caused deviations in PAT. For instance, interquartile range of PAT was statistically higher (p < 0.001, r c = 0.98) in low-rather than high-quality PPG segments.
The proportion of high-quality PPG during irregular rhythm was statistically lower (p < 0.001, r c = 0.75) than during regular rhythm intervals (see Figure 10c), which also might be related with a statistically higher (p < 0.001, r c = 0.74) interquartile range of PAT during irregular rhythm pulse waves (see Figures 9 and 10b).

PAT in Different Sleep Stages & Sleep-Disordered Breathing Events
An example of PAT variations in different sleep stages (wake, NREM1, NREM2, NREM3, REM) and during sleep-disordered breathing events (OSA, hypopnea, oxygen desaturation, and arousal) is provided in Figure 11. Additionally, the PPG signal and signal quality estimated by the ECG-guided algorithm are shown. Interquartile ranges of PAT distributions in different sleep stages (wake, NREM1, NREM2, NREM3, REM) and in different events related to sleep-disordered breathing (OSA (obstructive sleep apnea), HA (hypopnea), OxyDes (SpO2 desaturation), and Ar (arousal episodes)) are provided in Figure 12a and b, respectively. Comparing differences between distributions of different sleep stages (see Figure 12a) and events related to sleep-disordered breathing (see Figure 12b), interquartile ranges of PAT were the largest during wake (see Figure 11), oxygen desaturation, and arousal events, in which the proportions of high-quality PPG were the lowest. However, after postprocessing and eliminating PAT measurements derived from low-quality PPG signals deviations in PAT decreased, especially, in hypopnea, oxygen desaturation, and arousal segments (r c = 0.97, r c = 0.97, r c = 0.99, respectively, when p < 0.001). The decrease in deviations of PAT could be explained by the fact that a lower quality of the PPG signal results in a higher variability of PAT estimates.
The matched-pairs r c values of interquartile ranges of PAT distributions between different sleep stages and events related to sleep-disordered breathing are provided in Table 3 and Table 4, respectively (p < 0.001 and r c < 0.30 is marked * , p < 0.001 and r c ≥ 0.30- * * , p < 0.001 and r c ≥ 0.50- * * * ). According to Tables 3 and 4, it can be seen that PAT post-processing allows to obtain larger differences between different distributions in most cases. This is especially true during sleep stages, where PAT assessment might be used as a supplementary tool for hypnogram evaluation. Table 3. The matched-pairs r c values of interquartile ranges of PAT distributions between different sleep stages after (blue background) and before post-processing (red background). p < 0.001 and r c ≥ 0.30 is marked * * , p < 0.001 and r c ≥ 0.50- * * * .  Table 4. The matched-pairs r c values of interquartile ranges of PAT distributions between different events related to sleep-disordered breathing after (blue background) and before post-processing (red background), where OSA-obstructive sleep apnea, HA-hypopnea, OxyDes-oxygen desaturation, Ar-arousal events. p < 0.001 and r c < 0.30 is marked * , p < 0.001 and r c ≥ 0.30- * * , p < 0.001 and r c ≥ 0.50- * * * . The percentage changes of PAT during and 30 s after OSA and hypopnea episodes across all subjects are provided in Figure 13. Additionally, the percentage changes of SpO2 are provided for comparison. The results show that the percentage change is significantly higher after apnea rather than during apnea events. Statistically higher differences were obtained when comparing the distributions related to hypopnea than OSA (r c -0.97 > 0.88; 0.99 > 0.78, in SpO2 and PAT, respectively, when p < 0.001). However, the percentage changes of parameters were larger in value during and after OSA than hypopnea. For instance, median percentage changes of PAT were 3.1% > 2.1%, during OSA and hypopnea, respectively, and 4.4% > 3.2% after OSA and hypopnea, respectively. While median percentage changes of SpO2 were 3.1% > 1.1%, during OSA and hypopnea, respectively, and 5.2% > 2.1% after OSA and hypopnea, respectively.

Discussion
This study aimed to develop a PPG signal-quality assessment algorithm for robust PAT estimation, and investigate the influence of signal quality on PAT estimation during various sleep stages and events. The algorithm consisted of: (i) identifying R and T waves in ECG signals; (ii) determining the locations of PPG pulse onsets; (iii) assessing the variability in PPG pulse amplitudes; (iv) identifying low-quality PPG pulse waves; and (v) robust PAT estimation. The key findings were as follows. First, PPG signals were of mostly high quality during sleep and apnea episodes, but of lower quality whilst awake and during oxygen desaturation and arousal events. Second, a greater proportion of PPG signals were deemed to be of high quality when using the new approach compared to the reference algorithm. Third, a lower quality of the PPG signal was found to be significantly associated with a higher interquartile range of PAT distribution, which shows that assessing signal quality would lead to a more accurate PAT estimation. Fourth, PPG signal quality-based PAT post-processing reduced PAT deviations during PSG studies. Fifth, PAT tended to change significantly more after the apnea episode than during it, and these changes often correlate with SpO2.
Another study [56] also reveals that the highest quality of the PPG signal is observed during sleep (93.1% of the time). This is consistent with the results of our study, which showed that the majority of PPG signals during sleep were suitable for analysis. In addition, a lower PPG signal quality was observed during sleep-disordered breathing events, such as apnea-related oxygen desaturations and arousals, and during irregular rhythm episodes potentially related to arrhythmia.
The interquartile range of PAT distribution across all subjects was the highest in those segments in which the proportions of high-quality PPG were the lowest (see Figure 10a), i.e., wake, oxygen desaturation, and arousal events (see Figure 12). Furthermore, interquartile range of PAT during irregular rhythm was also higher than during regular rhythm beat-to-beat intervals (see Figure 10b), which corresponds to a lower proportion of highquality signal during irregular rhythm PPG pulse waves (see Figure 10c).
The results (see Figure 12) also revealed that PPG signal quality-based PAT postprocessing reduced PAT deviations (see Tables 3 and 4). Thus, this study showed that assessing PPG signal quality can lead to a more accurate PAT estimation. Consequently, it is important to exclude low-quality PPG segments from PSG analyses before evaluating nocturnal blood pressure response from PAT. Since the ECG signal is less susceptible to artifacts, it makes sense to use the ECG for evaluation of PPG signal quality during PSG. Therefore, such PPG signal quality-based PAT evaluation could enable to reduce obtained deviations and be used to identify outliers of PSG-derived PAT. On the other hand, the information on the higher interquartile range of PAT might be used to detect episodes of insomnia and micro-arousals, or be a supplementary tool for hypnogram evaluation during PSG.
In terms of PAT variability during apnea events, the percentage change analysis (see Figure 13) showed that PAT tended to change significantly more after the apnea episode with some time delay than during it. Considering that the quality of PPG signals can be affected by arousals occurring after apnea episodes, quality analysis for PAT monitoring becomes crucial. It is worth mentioning that PPG quality-based post-processing helped to highlight the dipping pattern of PAT, which could provide a clinically useful aid for sleep apnea monitoring during PSG studies.
The implemented ECG-guided algorithm was compared with the reference TM-based approach [28] for PPG signal-quality assessment. In the obtained results (see Figure 8), we might see a correlation between the distributions of different stages, but in some cases (e.g., wake and arousal segments) the proportion of high-quality PPG obtained by using the TM-based approach is much lower comparing it with the distributions of the ECG-guided algorithm. This could be explained by the fact that the TM-based approach assesses the quality of the PPG by using a 10-s window. Thus, even if only a few seconds are low quality, all 10 s will be classified as low quality. Therefore, it might underestimate the amount of high-quality data. Furthermore, it is important to note that the ECG-guided algorithm can be tuned to be more or less restrictive by changing the subtraction constant k or thresholds values, θ 1 and θ 2 , respectively.
It is important to mention that the TM-based approach is based on the assumption that in a high-quality PPG signal, all the pulse waves are similar in shape. However, this is not always the case. For instance, during cardiac arrhythmia, the pulse waves differ in duration and shape, even in a high-quality recording. These differences are caused by the physiology rather than by poor quality signals. Therefore, perhaps the TM-based approach is erroneously classifying PPG signals during irregular heart rhythms as low quality, when they should be classified as high quality.
Regarding computational efficiency, the implemented ECG-guided algorithm requires less computations than the reference algorithm, which is one of the advantages of our proposed approach. Thus, it would be more suitable to analyze long-term PPG signals rather than the TM-based approach.
The proposed algorithm has several limitations. The first limitation is the dependence of the parameters k, θ 1 , θ 2 of the algorithm on a specific equipment to record the PPG signal. Different amplifications and filtering of the PPG signal require new settings for the parameters k, θ 1 , and θ 2 . The algorithm could be modified to use normalized PPG signals in the future. Another limitation is the assumption that the T wave in the ECG is always present. However, in myocardial ischemia or injury, during electrolyte imbalances, or due to the use of certain medications, the T wave could be flat. In this case, the algorithm should be forced to switch to the mode of "No T wave detected" and relay only on PPG signal-based fiducial point detection.

Conclusions
To our knowledge, the quality of PPG signals during sleep stages and sleep-disordered breathing events has not previously been assessed. Our study revealed that PPG signals are of high quality during sleep and apnea events, whereas they are of lower quality whilst awake and during apnea-related oxygen desaturations and arousals. As well as, a lower quality of the PPG signal was found to be significantly associated with a higher interquartile range of PAT. Therefore, the implemented algorithm has a potential to increase the robustness of PAT estimation in PSG studies related to nocturnal blood pressure monitoring.  Acknowledgments: The Multi-Ethnic Study of Atherosclerosis (MESA) Sleep Ancillary study was funded by NIH-NHLBI Association of Sleep Disorders with Cardiovascular Health Across Ethnic Groups (RO1 HL098433). MESA is supported by NHLBI funded contracts HHSN268201500003I, N01-HC-95159, N01-HC-95160, N01-HC-95161, N01-HC-95162, N01-HC-95163, N01-HC-95164, N01-HC-95165, N01-HC-95166, N01-HC-95167, N01-HC-95168 and N01-HC-95169 from the National Heart, Lung, and Blood Institute, and by cooperative agreements UL1-TR-000040, UL1-TR-001079, and UL1-TR-001420 funded by NCATS. The National Sleep Research Resource was supported by the National Heart, Lung, and Blood Institute (R24 HL114473, 75N92019R002). The authors would like to thank Andrius Petrėnas for providing the algorithm of irregular rhythm detection and for useful suggestions on preparing the manuscript of the paper.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

Abbreviations
The following abbreviations are used in this manuscript: